package cn.gcyl.module.biz.dal.mysql.subscriptioninformation;

import java.util.*;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.module.biz.dal.dataobject.subscriptioninformation.SubscriptionInformationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gcyl.module.biz.controller.admin.subscriptioninformation.vo.*;

/**
 * 订阅信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SubscriptionInformationMapper extends BaseMapperX<SubscriptionInformationDO> {

    default PageResult<SubscriptionInformationDO> selectPage(SubscriptionInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SubscriptionInformationDO>()
                .eqIfPresent(SubscriptionInformationDO::getModule, reqVO.getModule())
                .eqIfPresent(SubscriptionInformationDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(SubscriptionInformationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(SubscriptionInformationDO::getUserId, reqVO.getUserId())
                .orderByDesc(SubscriptionInformationDO::getId));
    }

}